<template>
	<view class="content">
		<!-- <view v-for="(item ,index) in dataArr">
			<view class="w750">
				<view class="w750"><text>{{item.number}}</text></view>
				<view class="user-img w750 flex-align-center" v-for="(i,indexsd) in item.list">
					<view class="w200">
						<u--image :showLoading="true" :src="i.outsideChain" width="200rpx" height="200rpx">
						</u--image>
					</view>
				</view>
			</view>
		</view> -->
		<view v-for="(item ,index) in dataArr">
			<view class="w750">
				<text>{{item.number}}</text>
			</view>
			<view class="w750 flex-align-center">
				<view v-for="(i,indexsd) in item.list">
					<u--image :showLoading="true" :src="i.outsideChain" width="150rpx" height="150rpx"
						@click='pictureVire(index,i.outsideChain)'>
					</u--image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataArr: []
			}
		},
		onLoad(option) {
			this.getData(option.time)
		},
		methods: {
			getData(val) {
				let userId = uni.getStorageSync('userId')
				this.$get('/admin/project/file/date/indexId', {
					indexId: userId,
					workDate: val
				}).then(res => {
					console.log(res)
					this.dataArr = res.data
				})
			},
			pictureVire(index, images) {
				// 调用预览图片方法
				uni.previewImage({
					urls: [images],
					current: 0
				})
			}
		},
		filters: {
			formatDate: function(value) {
				var date = new Date(value); //时间戳为10位需*100,时间戳为13位的话不需乘1000
				var year = date.getFullYear();
				var month = ("0" + (date.getMonth() + 1)).slice(-2);
				var sdate = ("0" + date.getDate()).slice(-2);
				var hour = ("0" + date.getHours()).slice(-2);
				var minute = ("0" + date.getMinutes()).slice(-2);
				var second = ("0" + date.getSeconds()).slice(-2);
				// 拼接
				//var result = year + "." + month + "." + sdate + " " + hour + ":" + minute //+ ":" + second;
				let result = `${year}.${month}.${sdate}  ${hour}:${minute}`
				// 返回
				return result;
			}
		},
	}
</script>

<style scoped="">
	.user-img {
		float: left;
	}

	.user-data {
		width: 530rpx;
		height: 200rpx;
		float: right;
	}

	.tit {
		font-size: 23rpx;
	}

	.flex {
		display: flex;
	}
</style>
